﻿using Engine;
using Game;
//粉碎机
namespace Mekiasm
{
    public class CrusherWidget : BaseEnergyWidget
    {
        public ComponentCrusher componentCrusher;
        public CrusherWidget(ComponentCrusher componentCrusher, ComponentMiner componentMiner) : base(componentMiner)
        {
            this.componentCrusher = componentCrusher;
            MekCraftingRecipe.FindCraftDevice(typeof(Crusher)).GenerateRecipeWidget(CanvasMain,componentCrusher,componentMiner,ref Tick);
            setTitle("粉碎机");
        }

        public override void Update()
        {
            SetPowerProgress((float)componentCrusher.Power / (float)componentCrusher.MaxPower);
            SetLeftBottomMoreInfo($"能量消耗:{ILibrary.FormatPowerUse(componentCrusher.OutputPowerLimit)}\n当前储能:{ILibrary.FormatPower(componentCrusher.Power)}\n最大储能:{ILibrary.FormatPower(componentCrusher.MaxPower)}");
        }
    }
}
